/**
 * 
 */
package td2.Exception;

public class TestFinally {

	public TestFinally() {
		super();
	}
	
	public static void f(int n) throws Except{
		try {
			if (n!=1) throw new Except();
		}catch(Except e){
			System.out.println("catch dans f - n = " + n);
			throw e;
		}finally{
			System.out.println("dans finally - n = " + n);
		}
	}
	
	public static void main(String[] args){
		int n=0;
		try{
			for (n=1;n<5;n++)
				f(n);
		}catch(Except e){
			System.out.println("catch dans le main - n = " + n);
		}finally{
			System.out.println("dans le finally du main - n = "+ n);
		}
	}
}
